package com.zb.service;

import com.zb.dao.ListMsgMapper;
import com.zb.model.ListMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ListMsgService {
	
	@Autowired
	private ListMsgMapper lmm;

	public int addListMsg(ListMsg lm) {
		return lmm.insertListMsg(lm);
	}

	public List<ListMsg> selectListMadByType(int type) {
		if(type==0) {
			return lmm.selectAllListMsg();
		}else {
			return lmm.selectListMsgByType(type);
		}
	}

	public int delListById(String listId) {
		return lmm.delListMsgById(listId);
	}

	public List<ListMsg> selectListByType(int listtype) {
		return lmm.selectSomeListMsgByType(listtype);
	}
}
